package cn.tedu.boot3.mapper;

import cn.tedu.boot3.entity.Product;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProductMapper {



     @Insert("insert into  product values(null,#{title},#{price},#{num})")
    void insert(Product product);
     //查询到的数据会封装到对象里面并且把对象装进list集合,把集合作为返回值
     @Select("select id,title,price,num from product")
    List<Product> select();

     @Delete( "delect from product where id=#{id}")
    void delectById(int id);
     @Update("update product set title=#{title},price=#{price}"+
    ",num=#{num} where id=#{id}")
    void update(Product product);
}
